﻿/******************************************************************************
* File description: TimerCard_pause.qml
* Function: 暂停的计时
* Current Version: 1.0.0
* Author: JNN
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/

import QtQuick 2.0
import "../components"

// 动画里面的那个暂停

Rectangle {

    id: root
    radius: 8*dp

    height: Math.max(60*dp, width*0.2)
    width: 210*dp

    property int pauseSecond: gStateExp.expPauseTime        // 暂停了多少秒
    visible: gExpIsPause === 1

    property int pauseType: gStateExp.expPauseType  // type=0 正常的暂停 type=1 能谱图导致的暂停 type=2活检的暂停

    color: Qt.rgba(1, 1, 1, 0.6)

    // 图标
    Row{
        x: parent.width*0.05
        anchors.verticalCenter: parent.verticalCenter
        height: 30*dp;  width: parent.width - 2*x
        spacing: 5*dp
        CustomImage{
            height: 23*dp; width: 23*dp
            source: "qrc:/picture/pause.png"
            anchors.verticalCenter: parent.verticalCenter
        }
        Text{
            id: text_pause
            text: pauseType===0 ? "暂停中" : (pauseType===1 ? "检测中" : "活检中")
            font.pixelSize: config.fontsize_1
            anchors.verticalCenter: parent.verticalCenter
        }
        CustomImage{
            height: 16*dp; width: 16*dp
            anchors.verticalCenter: parent.verticalCenter
            source: "qrc:/picture/info.png"
        }
    }
    // 计时
    Text {
        text: qsTr(funcTools.second2Time(pauseSecond))
        font.pixelSize: parent.width*0.05 + 8*dp
        font.bold: true
        x: parent.width - width - parent.width*0.05
        anchors.verticalCenter: parent.verticalCenter
    }

    MouseArea{
        anchors.fill: parent
        hoverEnabled: true
        onEntered: {
            toolTip.visible = true
        }onExited: {
            toolTip.visible = false
        }
    }

    CustomTooltip{
        id: toolTip
        visible: false
        text: pauseType===0 ? "暂停中，请点击上方【继续】按钮以继续实验" : "能谱图检测中，请手动控制。点击上方【继续】按钮以继续实验"
    }


}
